home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
ms_dos
/
tool
/
fapxtool
/
src
/
txl
/
txltime.c
< prev
Wrap
C/C++ Source or Header
|
1994-10-19
|
677b
|
40 lines
/***************
*
* g:\exe\txl\src\txltime.c
*/
#include "txl.h"
void settime(char *tmstr)
{
int hour, minute, second;
struct dostime_t stm;
if (sscanf(tmstr, "%02d:%02d:%02d", &hour, &minute, &second) < 3) {
Exit(1);
}
stm.hour = hour;
stm.minute = minute;
stm.second = second;
stm.hsecond = 0;
_dos_settime(&stm);
}
void setdate(char *dtstr)
{
int year, month, day;
struct dosdate_t sdt;
if (sscanf(dtstr, "%02d/%02d/%02d", &year, &month, &day) < 3) {
Exit(1);
}
sdt.year = year + 1900;
if (sdt.year < 1980) {
sdt.year += 100;
}
sdt.month = month;
sdt.day = day;
sdt.dayofweek = 0;
_dos_setdate(&sdt);
}